<template>
  <div id="app">
    <pageHead></pageHead>
    <pageNav></pageNav>
    <keep-alive v-if="state">
        <typePage v-if="navIndex === 0"></typePage>
        <goodsPage v-if="navIndex === 1"></goodsPage>
        <liningPage v-if="navIndex === 2"></liningPage>
        <stereotypePage v-if="navIndex === 3"></stereotypePage>
        <designPage v-if="navIndex === 4"></designPage>
        <measurePage v-if="navIndex === 5"></measurePage>
        <measureMorePage v-if="navIndex === 6"></measureMorePage>
        <stitchworkPage v-if="navIndex === 7"></stitchworkPage>
        <logoPage v-if="navIndex === 8"></logoPage>
        <emergency v-if="navIndex === 9"></emergency>
        <userinfor v-if="navIndex === 10"></userinfor>
    </keep-alive>
    <pageLoad v-if="!state"></pageLoad>
  </div>
</template>

<script>
import {mapMutations, mapState} from 'vuex';
import pageHead from "base/pageHead.vue"
import pageNav from "base/pageNav.vue"
import pageLoad from "base/pageLoading.vue"
import _ from "lodash";

//页面
import typePage from "components/type/type.vue"
import goodsPage from "components/goods/goods.vue"
import liningPage from "components/lining/lining.vue"
import stereotypePage from "components/stereotype/stereotype.vue";
import designPage from "components/design/design.vue";
import measurePage from "components/measure/measure.vue";
import measureMorePage from "components/measureMore/measureMore.vue"
import stitchworkPage from "components/stitchwork/stitchwork.vue"
import logoPage from "components/logo/logo.vue";
import userinfor from "components/userinfor/userinfor.vue"
import emergency from "components/emergency/emergency.vue"
export default {
  name: 'app',
  data(){
    return {
        state:false,
    }
  },
  components:{
    pageHead,
    pageNav,
    typePage,
    goodsPage,
    liningPage,
    stereotypePage,
    designPage,
    measurePage,
    measureMorePage,
    stitchworkPage,
    logoPage,
    userinfor,
    pageLoad,
    emergency
  },
  computed:{
    ...mapState([
      'type',
      'navIndex'
    ])
  },
  created(){
      _.delay(()=>{
          this.state = true;
      },1000)
  }
}
</script>
<style lang="less">
   @import "common/style/style-index";

   #app{
     width:1150px;
   }
</style>
